package P129_SetQueueLength;

import org.junit.Test;

import java.util.ArrayList;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @author xufy
 * @version 1.0
 * @description 设置队列长度
 **/
public class SetQueueLength {

    @Test
    public void Test() {

        ArrayList<String> strings = new ArrayList<>(5);
        for (int i = 0; i < 10; i++) {
            strings.add("");
        }
        //队列不能扩容，需设置长度
        ArrayBlockingQueue<String> strings1 = new ArrayBlockingQueue<>(5);
        for (int i = 0; i < 10; i++) {
            strings1.add("");
        }
    }
}
